﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Terran
{
	public class ActionProduceGhostAcademy : ActionProduceFromSCV
	{
		public static ActionProduceGhostAcademy Instance = new ActionProduceGhostAcademy();

		private ActionProduceGhostAcademy() : base(40, 150, 50) { }

		public override string EventName { get { return "ActionSpawnGhostAcademy"; } }

		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return state.Barracks.Count + state.BarracksReactor.Count + state.BarracksTechLab.Count > 0;
		}

		public override TerranState.TerranBuilding GetBuilding(TerranState state) { return state.GhostAcademy; }

		private IAction[,] m_Requirements;
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceBarracks.Instance, ActionProduceRefinery.Instance } };
				return m_Requirements;
			}
		}
	}
}
